#include<iostream>
using namespace std;
#include<vector>
class Solution {
public:
    int findPoisonedDuration(vector<int>& t, int duration) {
        int ret = 0;
        for (int i = 1; i < t.size(); i++)
        {
            int tmp = t[i] - t[i - 1];
            if (tmp < duration) ret += tmp;
            else ret += duration;
        }
        return ret + duration;
    }
};

int main()
{
    return 0;
}